#ifndef DATA_H
#define DATA_H

// this is a container class
// populates tasks to internal vector

#include <iostream>
#include <string>
#include <vector>

#include <boost\date_time.hpp>
#include "Task.h"

using namespace std;
using namespace boost::posix_time;

class Data {
private:
	
	vector<Task> _list;
	int _taskNumber;

public:
	enum DataFeedback {
		SUCCESS,
		FAILURE
	};

	Data();
	~Data();

	DataFeedback executeAdd( Task task );

	DataFeedback executeDeleteTaskID( unsigned int taskID );

	DataFeedback executeClear();

	DataFeedback getAll( vector<Task>& taskPointers );
	DataFeedback getByTime( vector<Task>& taskPointers, ptime startTime,ptime endTime );
	DataFeedback getBySearchTerm( vector<Task>& taskPointers, string searchTerm );
	DataFeedback getByName( vector<Task>& taskPointers, string taskName );
	DataFeedback getByID( vector<Task>& taskPointers, int taskId );
	DataFeedback getByDone( vector<Task>& taskPointers );

	DataFeedback executeEdit( Task taskToEdit, int indexOfTask );
	DataFeedback executeSort( string typeOfSort );

	DataFeedback executeLoad( vector<Task> list );

	int getNumberOfTasks();
};

#endif